A search engine is a system for collecting and organizing information resources in the Internet and providing users with a searching capability. The system includes information collection, information organization and user query. Typically, a user inputs a keyword in the search engine to conduct a search, and the search engine finds content that matches with the keyword from an index database to feedback to the user.
Recently, a number of search engines provide a series of suggested search queries that are related to an original search query of a user. This series of suggested search queries is also referred to as an input recommendation, which corresponds to complete input strings that are recommended based on a partial input that is currently provided in an input box. For example, a search engine may include a query input area for receiving a textual input. A search service provides search query suggestions for the textual input, and a user may select a search query suggestion as a search query term. Input recommendations are mainly used for recommending a complete text that is potentially inputted by a user according to an existing partial input and facilitating the user to complete the textual input quickly during a process of user input. For example, if an original search term that is inputted by a user is “”, the search engine may offer relevant search terms such as “ (China)”, “ (center)”, “ (Chinese medicine)”, etc.
Currently, a method for providing an input recommendation mainly includes: generating an offline index for input recommendations and providing an online input recommendation. The procedure of generating the offline index for the input recommendations may also be referred to as creating the input recommendations, which may include: listing all prefixes for all recommended entries; combining different entries having the same prefix; generating an inverted index for recommended entries which prefixes are combined; sorting the inverted index of each prefix according to specific business needs; truncating the most important first N entries as input recommendations for a respective prefix; and generating a prefix index. The procedure of providing the online input recommendation may include: searching the prefix index according to a current input of a user in a text box and returning an index record based on the prefix index, the index record being an input recommendation that is provided.
However, at least the following problems are found in existing technologies of establishing an input recommendation:
Since the number of recommended entries is relatively large and the number of complete lists of prefixes for each recommended entries is also large, the number of all prefixes that are listed for all recommended entries is enormous. Within an inverted index that is created based on this enormous number of prefixes, a large number of index entries are hardly used, for example, some index entries with a relatively long prefix length. If a relatively short prefix points to a few entries, the created index may absolutely include entries that are pointed by longer prefixes. As such, index entries corresponding to the longer prefixes may rarely be used. As can be seen from the above explanation, redundancy exists in an input recommendation index created according to the existing methods.